package com.caine.mybatis.factory;

import com.caine.mybatis.sqlSession.CaineSession;
import org.springframework.beans.factory.FactoryBean;

/**
 * @Author: CaineZhu
 * @Description:
 * @Date: Created in 10:38 2020/11/2
 * @Modified By:
 */
public class CaineFactoryBean implements FactoryBean {

    private Class classInterface;

    public void setClassInterface(Class classInterface) {
        this.classInterface = classInterface;
    }

    @Override
    public Object getObject() throws Exception {
        return CaineSession.getMapper(classInterface);
    }

    @Override
    public Class<?> getObjectType() {
        return classInterface;
    }
}
